import request from "@/utils/request";

// 菜品的列表
export function dishList(data) {
  return request({
    url: "/dish/page",
    method: "get",
    data,
  });
}

// 添加菜品
export function createDish(data) {
  return request({
    url: "/dish",
    method: "post",
    data,
  });
}

// 编辑菜品
export function editDish(data) {
  return request({
    url: "/dish",
    method: "put",
    data,
  });
}

// 修改菜品状态
export function changeDishStatus(status, data) {
  return request({
    url: "/dish/status/" + status,
    method: "post",
    data,
  });
}

// 删除菜品
export function deleteDish(data) {
  return request({
    url: "/dish",
    method: "delete",
    data,
  });
}

// 获取菜品分类
export function dishCategoryList(data) {
  return request({
    url: "/category/list",
    method: "get",
    data,
  });
}